$(document).ready(function(){
	// 获取用户信息，并将用户信息渲染到界面上
	new HttpUtils().get("com.lvtu.dashboard.api.getUser", null, function(requestData){
		var data = requestData.data;
		$("#login_name").html("当前登录：" + data.username);
	});
	// 退出操作
	$("#logout").click(function() {
		new HttpUtils().get("com.lvtu.dashboard.api.logout", null, null);
		window.location.href="login.html";
	});
	
	$("#log_search").click(function() {
		changeClickActive($("#log_search"));
		window.open("log_search.html", null, "", true);
	});
	
	$("#sync_log").click(function() {
		changeClickActive($("#sync_log"));
		var mainContent = $("#main-cotent");
		mainContent.empty();
		mainContent.load("sync/sync_log.html", function(response, status, xhr) {
			mainContent.html(response);
		});
	});
	
	function changeClickActive(currentLi) {
		var childrens = $("#munu-bar").children();
		$.each(childrens, function (index, children) {
			$(children).removeClass("active");
		});
		currentLi.addClass("active");
	}
	
});